<div class="modal" tabindex="-1">
<!--
Licensed under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
  <div class="modal-md col-md-5 col-md-offset-3">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" ng-click="$hide()">
          <span>&times;</span></button>
        <h4 ng-bind="dialogTitle"></h4>
      </div>
      <div class="modal-body">
        <p style="padding-top: 4px; padding-bottom: 14px;">Application will be launched immediately,
          after the JAR file is uploaded.</p>

        <div ng-if="shouldNoticeSubmitFailed">
          <div class="alert alert-danger alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert"
                    ng-click="shouldNoticeSubmitFailed=false">
              <span aria-hidden="true">&times;</span>
            </button>
            Failed to submit the application.
            <span ng-if="error">
              Check out the
              <span class="help-text"
                    bs-tooltip="error" html="true" placement="bottom"
                    ng-click="showErrorInNewWin()">reason
                <i ng-if="hasStackTrace"
                   class="fa fa-external-link"></i></span>.
            </span>
          </div>
        </div>

        <form name="form" class="form-horizontal">
          <!-- right margin align to cancel button right -->
          <div style="margin-bottom: 18px">
            <!-- input 1 -->
            <form-control
              type="upload" label="Application JAR" required="true" autofocus="true"
              ng-model="jar" accept-pattern=".jar"></form-control>
            <!-- input 2 -->
            <form-control
              type="upload" label="Config File"
              ng-model="conf" accept-pattern="{{confFileSuffix}}"></form-control>
            <!-- input 3 -->
            <form-control
              ng-hide="isStormApp"
              type="integer" min="1" label="Executors"
              help="The number of executor (JVM) processes to be spawned in the cluster."
              ng-model="executorNum" ng-init="executorNum = 1"></form-control>

            <!-- input 4 -->
            <form-control
              type="text" label="Arguments"
              help="Application specific launch arguments (optional). E.g. WordCount can use &quot;-split 2 -sum 1&quot;"
              ng-model="launchArgs"></form-control>
          </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary btn-sm"
                ng-disabled="!canSubmit()" ng-click="submit()">
          <span ng-show="uploading"
                class="glyphicon glyphicon-repeat rotate-animation"></span>
          Submit
        </button>
        <button type="button" class="btn btn-default btn-sm" ng-click="$hide()">Cancel</button>
      </div>
    </div>
  </div>
</div>
